<template>
  <div class="right-container">
    <h3>Right 组件</h3>
    <hr />
    <p>count 值：0</p>
    <button @click="add" class="btn btn-warning">+1</button>
    <button @click="reqCartList" class="btn btn-warning">+1</button>

    <button @click="fn1">点我</button>
  </div>
</template>

<script>
import { mapMutations, mapActions } from 'vuex'
export default {
  name: 'Right',
  methods: {
    // add () {
    //   this.$store.commit('cart/add')
    // }
    ...mapMutations('cart', ['add']),
    ...mapActions('cart', ['reqCartList']),

    fn1 () {
      //  this.$store.commit('cart/add')
      this.add()
    }
  }
}
</script>

<style></style>
